'''
# 派生实例化除了父类的属性添加，还能有自己独有的属性 ******
# 在子类派生出的新方法中重用父类功能的方式二:super()必须在类中用
# super(自己的类名,自己的对象)
# 可以省略传值
# super()
'''
# 单继承下的super()
# class People:
#     school = '图灵学院'
#     def __init__(self, name, age, sex):
#         self.name = name
#         self.age = age
#         self.sex = sex
# class Student(People):
#     def __init__(self,name,age,sex,score=0):
#         # 相当于调用了父类的方法
#         # 指名道姓People
#         # People.__init__(self, name, age, sex)
#         # 必须要继承 Student父类的
#         # super(Student,self).__init__(name, age, sex)
#         # 可以省略传值
#         super().__init__(name, age, sex)
#         self.score = score
#     def play(self):
#         print('%s play football' % self.name)
# class Teacher():
#     def __init__(self,name,age,sex,hobby):
#         People.__init__(self, name, age, sex)
#         self.hobby = hobby
#     def course(self):
#         print('%s course' % self.name)
#
# s1 = Student('周阳', 38, 'male',99)
# print(s1.__dict__)
#
# t1 = Teacher('大海', 18, 'male','song')
# print(t1.__dict__)

# 多继承super()
# 广度优先
class A:
    def f1(self):
        print('A.f1')
        # super是照着mro列表c3算法来的
        #   # 不是按照当前继承的类来的
        super().f2()
class B:
    def f2(self):
        print('B.f2')
class C(A,B):
    def f2(self):
        print('C.f2')
obj=C()
obj.f1()
print(C.mro())